Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curvefs/client: fix bug of support summary info in dir xattr #1150

Merged
merged 2 commits into from
Mar 14, 2022

Conversation

SeanHai
Copy link
Contributor

@SeanHai SeanHai commented Mar 8, 2022

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

  1. Fix the summary info of hardlink when enableSumInDIr if false. Because batch get inodeAttr is divided by batch limit, the struct std::set will not deal with hardlink.
  2. Fix UpdateParentInodeXattr dirty flag, the update of xattr doesn't based on dirty flag.
  3. Disable hardlink when enableSumInDIr is true.
  4. batchGetInodeAttr and batchGetXattr from metaserver after find in inodeCache.

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@SeanHai SeanHai force-pushed the fixbug branch 6 times, most recently from 8e3d4e3 to cc15aa4 Compare March 10, 2022 06:46
@SeanHai
Copy link
Contributor Author

SeanHai commented Mar 10, 2022

recheck

// inodeid to parent inodeid, may have more parent at hard link
std::map<uint64_t, std::list<uint64_t>> parentIdMap_;
// inodeid to parent inodeid
std::map<uint64_t, uint64_t> parentIdMap_;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this only work if you turn it on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this only work if you turn it on?

Yes, the relationship is needed when turn on the enableSumInDir flag.

@SeanHai SeanHai force-pushed the fixbug branch 2 times, most recently from 3c14d0c to 58cd8e5 Compare March 11, 2022 02:39
@@ -1297,10 +1301,6 @@ CURVEFS_ERROR FuseClient::FuseOpRelease(fuse_req_t req, fuse_ino_t ino,
return ret;
}

if (enableSumInDir_) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not delete

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not delete

Oplookup will not called when vfs cached the info of inode, so if delete the relationship when release maybe lost the parent.

}
LOG(WARNING) << "AddParent but exist, inodeId = " << inodeId
<< ", parentId = " << parentIdMap_[inodeId]
<< ", need2AddParentId = " << parentId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check old parent and new parent are equal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check old parent and new parent are equal?

fixed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (parentIdMap_.count(inodeId) && parentIdMap_[inodeId] != parentId)
what happens here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (parentIdMap_.count(inodeId) && parentIdMap_[inodeId] != parentId) what happens here?

It won't happen normally, just do anomaly detection.

@SeanHai
Copy link
Contributor Author

SeanHai commented Mar 13, 2022

recheck

@SeanHai SeanHai merged commit 79140f7 into opencurve:master Mar 14, 2022
@SeanHai SeanHai deleted the fixbug branch April 14, 2022 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants